<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn" xml:lang="zh-cn">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="DC.Type" content="topic">
  <meta name="DC.Title" content="备份前准备">
  <meta name="product" content="">
  <meta name="DC.Relation" scheme="URI" content="kingbase-00005.html">
  <meta name="prodname" content="">
  <meta name="version" content="">
  <meta name="brand" content="30-OceanProtect 备份一体机 1.5.0-1.6.0 帮助中心">
  <meta name="DC.Publisher" content="20240320">
  <meta name="prodname" content="csbs">
  <meta name="documenttype" content="usermanual">
  <meta name="DC.Format" content="XHTML">
  <meta name="DC.Identifier" content="kingbase-00007_a1">
  <meta name="DC.Language" content="zh-cn">
  <link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
  <title>备份前准备</title>
 </head>
 <body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px">
  <a name="kingbase-00007_a1"></a><a name="kingbase-00007_a1"></a>
  <h1 class="topictitle1">备份前准备</h1>
  <div id="body0000002030927093">
   <p id="kingbase-00007_a1__zh-cn_topic_0000001505943769_p1921575423910">备份前，请参考<a href="#kingbase-00007_a1__zh-cn_topic_0000001505943769_table10744125193920">表1</a>提前准备相关信息。</p>
   <div class="note" id="kingbase-00007_a1__note141813814318">
    <img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span>
    <div class="notebody">
     <ul id="kingbase-00007_a1__ul17447111517311">
      <li id="kingbase-00007_a1__li18475121815115"><span id="kingbase-00007_a1__ph1292522251311">本节操作如无特殊说明均以操作系统版本是Linux localhost.localdomain 2.6.32-431.el6.x86_64，数据库版本是Kingbase V8.0为例进行，不同操作系统或数据库版本可能存在差异，请以实际为准。</span></li>
      <li id="kingbase-00007_a1__li135951626152410"><span id="kingbase-00007_a1__ph1879711368271">对于以集群方式部署的Kingbase数据库，如无特殊说明，均需登录集群实例所在的所有主机执行以下操作。</span></li>
     </ul>
    </div>
   </div>
   <div class="tablenoborder">
    <a name="kingbase-00007_a1__zh-cn_topic_0000001505943769_table10744125193920"></a><a name="zh-cn_topic_0000001505943769_table10744125193920"></a>
    <table cellpadding="4" cellspacing="0" summary="" id="kingbase-00007_a1__zh-cn_topic_0000001505943769_table10744125193920" frame="border" border="1" rules="all">
     <caption>
      <b>表1 </b>备份前准备
     </caption>
     <colgroup>
      <col style="width:26.93%">
      <col style="width:60.040000000000006%">
      <col style="width:13.03%">
     </colgroup>
     <thead align="left">
      <tr id="kingbase-00007_a1__zh-cn_topic_0000001505943769_row17745751113919">
       <th align="left" class="cellrowborder" valign="top" width="26.93%" id="mcps1.3.3.2.4.1.1"><p id="kingbase-00007_a1__zh-cn_topic_0000001505943769_p07451351153920">准备项</p></th>
       <th align="left" class="cellrowborder" valign="top" width="60.040000000000006%" id="mcps1.3.3.2.4.1.2"><p id="kingbase-00007_a1__zh-cn_topic_0000001505943769_p374585115396">获取方式</p></th>
       <th align="left" class="cellrowborder" valign="top" width="13.03%" id="mcps1.3.3.2.4.1.3"><p id="kingbase-00007_a1__zh-cn_topic_0000001505943769_p153691420200">数据使用章节</p></th>
      </tr>
     </thead>
     <tbody>
      <tr id="kingbase-00007_a1__zh-cn_topic_0000001505943769_row169941864113">
       <td class="cellrowborder" valign="top" width="26.93%" headers="mcps1.3.3.2.4.1.1 "><p id="kingbase-00007_a1__zh-cn_topic_0000001311214069_p1041419595410"><span id="kingbase-00007_a1__text11280184116112">用户名</span></p></td>
       <td class="cellrowborder" valign="top" width="60.040000000000006%" headers="mcps1.3.3.2.4.1.2 ">
        <div class="p" id="kingbase-00007_a1__p1481913395319">
         数据库安装用户名可通过以下方式查询。
         <ol id="kingbase-00007_a1__ol775354125917">
          <li id="kingbase-00007_a1__li157541941594">使用PuTTY登录Kingbase数据库所在主机。</li>
          <li id="kingbase-00007_a1__li20555010105919">执行以下命令，查询Kingbase数据库安装用户名。数据库端口是注册数据库时用户设置的，默认为54321。<pre class="screen" id="kingbase-00007_a1__screen5866193918598">ss -ntlp | grep <em id="kingbase-00007_a1__i11990164305">数据库端口</em></pre> <p id="kingbase-00007_a1__p66160360216">回显类似如下信息，其中<strong id="kingbase-00007_a1__b2536678410">kingbase</strong>为数据库安装用户名。</p> <pre class="screen" id="kingbase-00007_a1__screen2186355310">users:(("kingbase",25085,4))
LISTEN     0      128                       *:54321                    *:*      users:(("kingbase",25085,3))</pre></li>
         </ol>
        </div></td>
       <td class="cellrowborder" rowspan="3" valign="top" width="13.03%" headers="mcps1.3.3.2.4.1.3 "><p id="kingbase-00007_a1__zh-cn_topic_0000001505943769_p121306421565"><a href="kingbase-00009.html">步骤2：注册Kingbase单实例下的数据库</a></p> <p id="kingbase-00007_a1__p1719579345"><a href="kingbase-00010.html">步骤3：注册Kingbase集群实例下的数据库</a></p></td>
      </tr>
      <tr id="kingbase-00007_a1__row628184215619">
       <td class="cellrowborder" valign="top" headers="mcps1.3.3.2.4.1.1 "><p id="kingbase-00007_a1__p828144285614"><span id="kingbase-00007_a1__text96424529522">数据库安装路径</span></p></td>
       <td class="cellrowborder" valign="top" headers="mcps1.3.3.2.4.1.2 ">
        <ol id="kingbase-00007_a1__ol88611169718">
         <li id="kingbase-00007_a1__li1451916133813">使用PuTTY登录Kingbase数据库所在主机。</li>
         <li id="kingbase-00007_a1__li6507314189">执行以下命令，查看Kingbase数据库安装路径。<pre class="screen" id="kingbase-00007_a1__screen139621143894">ps -ef | grep kingbase</pre> <p id="kingbase-00007_a1__p1849543321414">单机实例回显如下所示：</p> <p id="kingbase-00007_a1__p1985310406144"><span><img id="kingbase-00007_a1__image1342033716220" src="zh-cn_image_0000001994349446.png"></span></p> <p id="kingbase-00007_a1__p180919711512">集群实例回显如下所示：</p> <p id="kingbase-00007_a1__p62584119519"><span><img id="kingbase-00007_a1__image183234417918" src="zh-cn_image_0000002031655989.png"></span></p></li>
        </ol></td>
      </tr>
      <tr id="kingbase-00007_a1__row10214832195811">
       <td class="cellrowborder" valign="top" headers="mcps1.3.3.2.4.1.1 "><p id="kingbase-00007_a1__p1656825155318"><span id="kingbase-00007_a1__text9799162385313">业务IP地址</span></p></td>
       <td class="cellrowborder" valign="top" headers="mcps1.3.3.2.4.1.2 ">
        <ol id="kingbase-00007_a1__ol1045712015277">
         <li id="kingbase-00007_a1__li945782082719">使用PuTTY登录Kingbase数据库所在主机。</li>
         <li id="kingbase-00007_a1__li1034854434210">获取listen_addresses字段值。
          <ol type="a" id="kingbase-00007_a1__ol64031321124310">
           <li id="kingbase-00007_a1__li186938417272">执行以下命令，查看Kingbase数据库数据目录。<pre class="screen" id="kingbase-00007_a1__screen9693241192716">ps -ef | grep kingbase</pre> <p id="kingbase-00007_a1__p1672364652817">单机实例回显如下所示：</p> <p id="kingbase-00007_a1__p4741252202818"><span><img id="kingbase-00007_a1__image131326141897" src="zh-cn_image_0000001994359018.png"></span></p> <p id="kingbase-00007_a1__p1094322210620">集群实例回显如下所示：</p> <p id="kingbase-00007_a1__p9301332962"><span><img id="kingbase-00007_a1__image195321924171314" src="zh-cn_image_0000002031577533.png"></span></p></li>
           <li id="kingbase-00007_a1__li208231050114313">执行以下命令，进入Kingbase数据库数据目录。<pre class="screen" id="kingbase-00007_a1__screen28241504437">cd <em id="kingbase-00007_a1__i168071530104419">/opt/Kingbase/ES/V8/data</em></pre></li>
           <li id="kingbase-00007_a1__li5824105034317">执行以下命令，打开kingbase.conf文件。<pre class="screen" id="kingbase-00007_a1__screen18241650114317">vim kingbase.conf</pre></li>
           <li id="kingbase-00007_a1__li11824350174310">执行以下命令，搜索listen_addresses所在行<pre class="screen" id="kingbase-00007_a1__screen182411507434">/listen_addresses</pre> <p id="kingbase-00007_a1__p19824850194318">回显如下所示：</p>
            <div class="p" id="kingbase-00007_a1__p1982425014313">
             <span><img id="kingbase-00007_a1__image6824175016433" src="zh-cn_image_0000002031627657.png"></span>
             <div class="note" id="kingbase-00007_a1__note919211276469">
              <span class="notetitle"> 说明： </span>
              <div class="notebody">
               <p id="kingbase-00007_a1__p19384123910468">如果配置值为*，则取登录数据库后台的IP。</p>
               <p id="kingbase-00007_a1__p1937163910461">如果配置值为IP地址，单机则取listen_addresses字段值中的任意一个IP，集群则取listen_addresses字段值中的主节点IP。</p>
              </div>
             </div>
            </div></li>
           <li id="kingbase-00007_a1__li9819181864115">执行以下命令，查询主节点IP，<strong id="kingbase-00007_a1__b72365305">primary</strong>所在行的IP为主节点IP。<pre class="screen" id="kingbase-00007_a1__screen19113440418">su - kingbase -c '/安装目录/bin/repmgr cluster show'</pre> <p id="kingbase-00007_a1__p11611122654311">回显如下所示：</p> <p id="kingbase-00007_a1__p860882516115"><span><img id="kingbase-00007_a1__image63171278436" src="zh-cn_image_0000002087918028.png"></span></p></li>
          </ol></li>
        </ol></td>
      </tr>
     </tbody>
    </table>
   </div>
  </div>
  <div>
   <div class="familylinks">
    <div class="parentlink">
     <strong>父主题：</strong> <a href="kingbase-00005.html">备份</a>
    </div>
   </div>
  </div>
 </body>
</html>